package com.share.user.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.share.common.core.context.SecurityContextHolder;
import com.share.user.domain.UserInfo;
import com.share.user.service.IUserInfoService;
import com.share.user.service.UserInfoService;
import com.share.user.mapper.UserInfoMapper;
import org.springframework.stereotype.Service;

/**
* @author zt181
* @description 针对表【user_info(用户表)】的数据库操作Service实现
* @createDate 2025-07-01 17:47:45
*/
@Service
public class UserInfoServiceImpl extends ServiceImpl<UserInfoMapper, UserInfo>
    implements UserInfoService, IUserInfoService {

    @Override
    public Boolean isFreeDeposit() {
        //微信支付分
        //https://pay.weixin.qq.com/wiki/doc/apiv3/payscore.php?chapter=18_1&index=2
        // 默认免押金，模拟实现
        UserInfo userInfo = this.getById(SecurityContextHolder.getUserId());
        userInfo.setDepositStatus("1");
        this.updateById(userInfo);
        return true;
    }
}




